package com.wty.emp.controller;

import com.wty.commons.result.Result;
import com.wty.emp.pojo.JobWty;
import com.wty.emp.service.JobServiceWty;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:wangtianyu
 * @Date：Created on 2020/4/21 0021 15:45
 */
@RestController
@RequestMapping("jobs")
public class JobControllerWty {

    @Autowired
    private JobServiceWty jobService;

    @ApiOperation(value = "新增部门",notes = "新增部门")
    @ApiImplicitParam(name = "job",value = "job基本信息",required = true,dataType = "JobWty", dataTypeClass = JobWty.class)
    @PostMapping
    public Result addJob(@RequestBody JobWty job)throws Exception{
        job = jobService.addJob(job);
        return Result.OK(job);
    }

}
